--- a/libusb/io.c	2014-01-11 16:34:55.811463881 +0100
+++ b/libusb/io.c	2014-01-11 16:35:26.138281377 +0100
@@ -34,6 +34,13 @@
 #include <sys/timerfd.h>
 #endif
 
+#ifndef TIMESPEC_TO_TIMEVAL
+#define TIMESPEC_TO_TIMEVAL(tv, ts) {		\
+	(tv)->tv_sec = (ts)->tv_sec;		\
+	(tv)->tv_usec = (ts)->tv_nsec / 1000;	\
+}
+#endif
+
 #include "libusbi.h"
 
 /**
